<?php
$params = array_merge(
    require __DIR__ . '/../../common/config/params.php',
//    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php'
//    require __DIR__ . '/params-local.php'
);

return [
    'id' => 'app-pay',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'pay\controllers',
    'bootstrap' => ['log'],
    'modules' => [],
    'components' => [
        'request' => [
            'cookieValidationKey' => 'true',
            'csrfParam' => '_csrf-pay',
            'enableCsrfValidation' => false,//关闭CSRF认证
            'enableCsrfCookie' => false,//关闭CSRF认证
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-pay', 'httpOnly' => true],
        ],
        'session' => [
            'name' => 'advanced-pay',
            'class' => 'yii\redis\Session',
            'redis' => [
                'hostname' => 'localhost',
                'port' => 6379,
                'database' => 0,
            ],
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=pay_terrace',
            'username' => 'root',
            'password' => '698a80e4212ba38f',
            'charset' => 'utf8',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [

            ],
        ],

    ],
    'modules' => [
        'backend' => [
            'class' => 'pay\modules\backend\Module',
        ],
        'frontend' => [
            'class' => 'pay\modules\frontend\Module',
        ],
    ],


    'params' => $params,
];
